package com.hxzy.tzxm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hxzy.tzxm.domain.CmsCategory;
import com.hxzy.tzxm.domain.CmsContent;
import com.hxzy.tzxm.domain.dto.CmsContentSearchDTO;
import com.hxzy.tzxm.domain.vo.CmsContentVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CmsContentMapper extends BaseMapper<CmsContent> {

    /**
     * 分页查询
     * @param page
     * @param cmsContentSearchDTO
     * @return
     */
    IPage<CmsContent> search(IPage<CmsContent> page, @Param(value = "dto") CmsContentSearchDTO cmsContentSearchDTO);

    /**
     * 根据id查询
     * @param id
     * @return
     */
    CmsContentVO findById(Long id);

    @Update(value = "update cms_content set del_flag='2' where id=#{id}")
    int updateDelFlag(long id);
}
